package cn.genmer.test.security.thread;

import lombok.SneakyThrows;

public class MyRunnable implements Runnable {
    @SneakyThrows
    @Override
    public void run() {
        Thread.sleep(3000);
        System.out.println("执行子线程");
    }

    public static void main(String[] args) throws InterruptedException {
        System.out.println("执行主线程");
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
        thread.start();
        thread.join();
        System.out.println("主线程执行结束");
    }
}
